import useCounter from "./自定义hooks"
let UseCustomHook = () => {

    let [count, method] = useCounter<number>(20)

    // console.log(method);
    return (
        <fieldset>
            <legend>使用自定义hook</legend>
            <button onClick={() => { method.decrement }}>-</button>
            &nbsp;
            <h2>{count}</h2>
            &nbsp;
            <button onClick={() => { method.increment }}>+</button>
        </fieldset>
    )
}

export default UseCustomHook